#pragma once
#include "BmpBtn.h"

class GUI_API CBmpAnimateCtrl :	public CBmpBtn
{
public:
	CBmpAnimateCtrl(void);
	/**
	*@param[in]  nID		 Specifies the  ID       of the control
	*/
	CBmpAnimateCtrl(UINT nID);
	/**
	*@param[in]  strCaption  Specifies the  caption  of the control 
	*@param[in]  nID		 Specifies the  ID       of the control
	*/
	CBmpAnimateCtrl(wstring strCaption,UINT nID);
	/**
	*@param[in]  dwStyle Specifies the  style of the control
	*@li @c SWS_STATIC   static control without any vents
	*@li @c SBS_ACTIVE  
	*@li @c SBS_ROUND
	*@li @c SBS_RECT
	*@param[in]  strCaption  Specifies the  caption  of the control 
	*@param[in]  rc           Specifies the  position of the control
	*@param[in]  nID		 Specifies the  ID       of the control
	*/
	CBmpAnimateCtrl(DWORD dwStyle, wstring strCaption,const CRect &rc, UINT nID);
	/**
	*@param[in]  dwStyle Specifies the  style of the control
	*@li @c SWS_STATIC   static control without any vents
	*@li @c SBS_ACTIVE  
	*@li @c SBS_ROUND
	*@li @c SBS_RECT
	*@param[in]  strCaption  Specifies the  caption  of the control 
	*@param[in]  x           Specifies the  position of the left side of the control
	*@param[in]  y           Specifies the  position of the top  side of the control
	*@param[in]  cx          Specifies the  position of the width of the control
	*@param[in]  cy          Specifies the  position of the control
	*@param[in]  nID		 Specifies the  ID       of the control
	*/
	CBmpAnimateCtrl(DWORD dwStyle, wstring strCaption, int x, int y, int cx, int cy, UINT nID);

	virtual ~CBmpAnimateCtrl(void);

public:

	/**
	*@brief Set the icon number that in the image list
	*@param[in] frameNum  Icon number in the image list
	*@return  No return value
	*/
	inline void SetFrameNum(int frameNum)
	{
		m_nIconNum = frameNum;
	}

	/**
	*@brief Start animation
	*@return   No return value
	*/
	inline void Play()
	{
		m_bPlay = TRUE;
	}

	/**
	*@brief Stop animation
	*@return   No return value
	*/
	inline void Stop()
	{
		m_bPlay = FALSE;
	}

	virtual void Paint(CDC* pDC);

private:
	int     m_nIndex;
	BOOL    m_bPlay;

};
